/*8：如果斐波拉切数列的前N项，N由用户输入。
斐波拉切数列的定义是前两个是1，后面的每一个是前面的两个和
，比如N是5,则输出结果是1,1,2,3,5*/
package ZUOYE0421;

import java.util.Scanner;

public class 更改作业8 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入n：");
		int n = in.nextInt();
		System.out.print("1,1");
		for (int a = 1, b = 1, c = 0, d = 1; d <= n - 2; d++) {
			c = a + b;
			a = b;
			b = c;
			System.out.print("," + c);

		}

	}

}
